package com.jian.java;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.jms.core.JmsTemplate;
import org.springframework.stereotype.Component;

/**
 * @author Jiange
 * @create 2021-05-28-13:29
 */
@Component
public class SpringConsumer {
    @Autowired
    JmsTemplate jmsTemplate;
    public static void main(String[] args) {
        ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("");
        SpringConsumer consumer = context.getBean(SpringConsumer.class);

        String o = (String) consumer.jmsTemplate.receiveAndConvert();

        System.out.println(o);
    }
}
